﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Hotel.Domain;
using HAINGUYEN_HOTEL.Helper;

namespace HAINGUYEN_HOTEL
{
    public partial class us_OrderStatus : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BindData();
        }
        
        public void BindData()
        {
            if (Session[SessionKey.MyRoom] != null)
            {
                var list = Session[SessionKey.MyRoom] as List<MyRoom>;
                lbPersonNumber.Text = list.Sum(p => p.SoNguoi).Value.ToString("D2");
                lbRoomNumber.Text = list.Sum(p => p.SoLuong).Value.ToString("D2");
                upStatus.Update();
            }
            else
            {
                lbPersonNumber.Text = "0";
                lbRoomNumber.Text = "0";
                upStatus.Update();
            }
        }
    }
}